package com.classic.greendao.generator;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyDaoGenerator {
    private static final String SAVE_PATH = "/Users/classic/ClassicSource/shopping/app/src/main/java";

    public static void main(String[] args) throws Exception {

        Schema schema = new Schema(1000, "com.shanwen.shopping.dao");

        addShoppingCart(schema);

        new DaoGenerator().generateAll(schema, SAVE_PATH);
    }

    private static void addShoppingCart(Schema schema) {
        Entity entity = schema.addEntity("ShoppingCartItem");
        entity.setTableName("t_shoppingcart");
        entity.addIdProperty().autoincrement().primaryKey();
        entity.addLongProperty("goodsId");
        entity.addLongProperty("skuId");
        entity.addStringProperty("title");
        entity.addStringProperty("shortDesc");
        entity.addStringProperty("sellPoint");
        entity.addStringProperty("detailUrl");
        entity.addStringProperty("coverUrl");
        entity.addStringProperty("skuPropName");
        entity.addStringProperty("skuPropValue");
        entity.addIntProperty("price");
        entity.addIntProperty("number");
    }

}
